From c3a5cde5165ae7ed0ffeacb5743203a1c0ecf33d Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 7 Jun 2007 11:02:23 +0100 Subject: [PATCH] tools: Fix some type issues GCC 4.1.0 warnings. FC5's gcc 4.1.0 can't make some files in tools/ due to its stronger type checking. From: Dexuan Cui Signed-off-by: Keir Fraser --- tools/console/daemon/io.c | 3 ++- tools/ioemu/target-i386-dm/exec-dm.c | 25 ++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 29090db506..92c57ec605 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -183,7 +183,8 @@ static int create_domain_log(struct domain *dom) { char logfile[PATH_MAX]; char *namepath, *data, *s; - int fd, len; + int fd; + unsigned int len; namepath = xs_get_domain_path(xs, dom->domid); s = realloc(namepath, strlen(namepath) + 6); diff --git a/tools/ioemu/target-i386-dm/exec-dm.c b/tools/ioemu/target-i386-dm/exec-dm.c index a45bef2925..ca208b0839 100644 --- a/tools/ioemu/target-i386-dm/exec-dm.c +++ b/tools/ioemu/target-i386-dm/exec-dm.c @@ -448,18 +448,29 @@ extern unsigned long logdirty_bitmap_size; void memcpy_words(void *dst, void *src, size_t n) { while (n >= sizeof(long)) { - *((long *)dst)++ = *((long *)src)++; + *((long *)dst) = *((long *)src); + dst = ((long *)dst) + 1; + src = ((long *)src) + 1; n -= sizeof(long); } - if (n & 4) - *((uint32_t *)dst)++ = *((uint32_t *)src)++; + if (n & 4) { + *((uint32_t *)dst) = *((uint32_t *)src); + dst = ((uint32_t *)dst) + 1; + src = ((uint32_t *)src) + 1; + } - if (n & 2) - *((uint16_t *)dst)++ = *((uint16_t *)src)++; + if (n & 2) { + *((uint16_t *)dst) = *((uint16_t *)src); + dst = ((uint16_t *)dst) + 1; + src = ((uint16_t *)src) + 1; + } - if (n & 1) - *((uint8_t *)dst)++ = *((uint8_t *)src)++; + if (n & 1) { + *((uint8_t *)dst) = *((uint8_t *)src); + dst = ((uint8_t *)dst) + 1; + src = ((uint8_t *)src) + 1; + } } void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, -- 2.30.2